package com.yjd.bi.rewards.service.impl;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;
import org.springframework.stereotype.Service;

import com.yjd.comm.base.dao.IBaseDao;
import com.yjd.comm.base.service.impl.BaseServiceImpl;
import com.yjd.bi.rewards.model.FundsFinancialModel;
import com.yjd.bi.rewards.service.IFundsFinancialService;
import com.yjd.bi.rewards.dao.IFundsFinancialDao;

/**
 * <b>description</b>：理财金业务实现<br>
 * <b>time</b>：2016-08-17 16:11:59 <br>
 * <b>author</b>：  renbangjie renbangjie@126.com
 */
@Service("fundsFinancialService")
public class FundsFinancialServiceImpl extends BaseServiceImpl implements IFundsFinancialService {

	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public FundsFinancialModel insert(FundsFinancialModel model) throws Exception {
		return this.fundsFinancialDao.insertModel(model, true);
	}

	/**
	 * 更新
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(FundsFinancialModel model) throws Exception {
		return this.fundsFinancialDao.updateModel(model, true);
	}

	/**
	 * 根据id删除
	 * 
	 * @param volume_id
	 * @return
	 * @throws Exception
	 */
	public int delete(long volume_id) throws Exception {
		Map<Object, Object> paramMap = new HashMap<Object, Object>();
		paramMap.put("volume_id", volume_id);
		return this.fundsFinancialDao.deleteModel(paramMap, true);
	}
	
	
	@Override
	public Double getTotalAmount(Map<String, Object> paramMap) {
		return fundsFinancialDao.getTotalAmount(paramMap);
	}
	

	@Resource
	private IFundsFinancialDao fundsFinancialDao;

	@Override
	public IBaseDao getBaseDao() {
		return this.fundsFinancialDao;
	}
	

}
